import { useReactive } from "ahooks";
import routers from "../../public/routers.json";

export default function routersModal() {
    let state = useReactive({
        routers,
        siderMenu: {},
        breadcrumbs: [],
    });

    const setBreadcrumbs = (breadcrumbs) => (state.breadcrumbs = breadcrumbs);

    const addBreadcrumb = (breadcrumb) => {
        state.breadcrumbs.push(breadcrumb);
    };

    return { ...state, setBreadcrumbs, addBreadcrumb };
}
